package com.sk.sqd.builder;

import com.sk.sqd.dto.StudentDTO;

/**
 * StudentDTO 的 builder
 */
public class StudentBuilder {

    private String name;

    private Integer age;

    private String hobby;

    public StudentDTO build() {
        return new StudentDTO(
                this.name,
                this.age,
                this.hobby);
    }

    public StudentBuilder name(String name) {
        this.name = name;
        return this;
    }

    public StudentBuilder age(Integer age) {
        this.age = age;
        return this;
    }

    public StudentBuilder hobby(String hobby) {
        this.hobby = hobby;
        return this;
    }

    @Override
    public String toString() {
        return "StudentBuilder{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", hobby='" + hobby + '\'' +
                '}';
    }
}
